/*
 * Copyright (C) 2009 Christoph Caks
 *
 * This file is part of GLWAK.
 *
 * GLWAK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GLWAK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with GLWAK.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * windowTest.cpp
 *
 *  Created on: 01.08.2009
 *      Author: Christoph Caks
 */

#include <iostream>

#ifdef GLWAK_WINDOWS
#include <windows.h>
#define sleep(n) Sleep(1000 * n)
#endif

#include "Window.h"

#include "WindowConfiguration.h"

#include "GLWAKFactory.h"

using namespace glwak;
using namespace std;
int windowTest() {

	try {

		WindowConfiguration windowConfig;

		glwak::Window *window = GLWAKFactory::createWindow();

		window->setConfiguration( windowConfig );


		window->initialize();

		cout << "show window" << endl;
		window->show();

		window->startMessageThread();

		sleep( 5 );

		cout << "hide window" << endl;
		window->hide();

		sleep( 5 );

		cout << "show window" << endl;
		window->show();

		sleep( 5 );

		cout << "hide window" << endl;
		window->hide();

		return 0;
	}
	catch ( char const *e ) {
		cout << "Exception has been thrown: " << e << endl;
		return 1;
	}

}

int main( int args, char** argv ) {
	return windowTest();
}
